#include "mainwindow.h"
#include "ui_mainwindow.h"

MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    ui->setupUi(this);
}

MainWindow::~MainWindow()
{
    delete ui;
}

void MainWindow::on_pushButton_clicked()
{
    const int integer=1;
    const int real=2;
     int curstate=real;
    QString string=ui->textEdit->toPlainText();
        if (curstate==real)
        {
            switch (string[0].toAscii())
            {
            case 'i':
            case 'j':
            case 'k':
            case 'l':
            case 'm':
            case 'n':
                curstate=integer;
                break;
            }
        }
    if (curstate==integer)
    ui->textEdit_2->insertPlainText("correct ");
    else
    ui->textEdit_2->insertPlainText("wrong name ");
}
